package ch.zbw.pra.sysventory.database.mapper;

import java.io.Serializable;
import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import ch.zbw.pra.sysventory.model.Processor;

/**
 * Mapping von einem Resultset auf ein Processor Objekt
 * 
 * @author Roberto Lucas
 */

public class ProcessorMapper implements RowMapper<Processor>, Serializable {
	
	private static final long serialVersionUID = 2532874111010242544L;

	public Processor mapRow(ResultSet rs, int rowNum) throws SQLException {
		Processor processor = new Processor();
		processor.setProcessorId(rs.getInt("procID_pk"));
		processor.setNameProcessor(rs.getString("procName"));
		processor.setFamilyProcessor(rs.getString("procFamily"));
		processor.setCoresProcessor(rs.getInt("procCores"));
		processor.setClockProcessor(rs.getInt("procClock"));	
		return processor;
	}

}
